package com.cw.base.jeeyc.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cw.base.common.model.dto.response.CommonRespDto;
import com.cw.base.jeeyc.sys.dto.SysExceptionTradeDto;
import com.cw.base.jeeyc.sys.intf.SysExceptionTradeQueryApi;
import com.cw.base.jeeyc.biz.intf.SysExceptionTradeQueryBiz;

/**
 * 异常登记
 *
 * @author admin
 * @date 2020-08-02 12:07:20
 */
@RestController
@RequestMapping("/v1/sysExceptionTradeQuery")
public class SysExceptionTradeQueryApiImpl implements SysExceptionTradeQueryApi {
    @Autowired
    private SysExceptionTradeQueryBiz sysExceptionTradeBiz;

    /**
     * 分页查询异常登记
     *
     * @param request 条件
     * @return PageInfo<SysExceptionTradeDto>
     */
    @Override
    public CommonRespDto<Page<SysExceptionTradeDto>> selectPage(@RequestBody SysExceptionTradeDto request) {
        Page<SysExceptionTradeDto> pageInfo = sysExceptionTradeBiz.selectPage(request);
        return CommonRespDto.<Page<SysExceptionTradeDto>>builder()
            .data(pageInfo)
            .build();
    }

    /**
     * 查询异常登记详情信息
     *
     * @param request 条件
     * @return SysExceptionTradeDto
     */
    @Override
    public CommonRespDto<SysExceptionTradeDto> queryDetail(@RequestBody SysExceptionTradeDto request) {
        SysExceptionTradeDto sysExceptionTradeDto = sysExceptionTradeBiz.queryDetail(request);
        return CommonRespDto.<SysExceptionTradeDto>builder()
            .data(sysExceptionTradeDto)
            .build();
    }
}
